<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>WanDa</title>
<script type="text/javascript" src="/skin/WDYYhtml/js/jquery.js"></script>
<script type="text/javascript" src="/skin/WDYYhtml/js/common.js"></script>
<link rel="stylesheet" href="/skin/WDYYhtml/css/style.css" type="text/css" media="all" />
</head>

<body>
<div class="header-wrapper">
	#parse('/inc/header.htm')
</div>

<!---->
<div id="Wrapper">
	<div class="wrapper">
		<!---->
		<div class="banner">
			<img src="/skin/WDYYhtml/images/banner_activity.jpg" alt="" />
		</div>
		
		<!---->
		<div class="page-nav">
				<a href="/index.do">首页</a> / 
				#set($allTypes=$thisType.getParentTypes())
				#foreach($aType in $allTypes)
				<a href="$aType.getHref()">$aType.getName()</a> / 
				#end 
				<em>$!thisType.name</em>
		</div>
		
		<!---->
		<div class="menu" id="pMenu">
			#set($arootType=$thisType.getRootType())
			#foreach($atype in $arootType.getSubTypes(1))
			<a href="$atype.href"
		    #if($atype.id.equals($thisType.id)) class="now"#end
		    >$atype.name</a>
			#end
		</div>
		
		<!---->
		<div class="actdo" id="ActDo">
			<h3>活动订阅 &nbsp;&nbsp; /</h3>
			
			<div class="do">
				<strong>我想用手机订阅</strong>
				<p><input id="doPhone" type="text" name="" /><label for="doPhone">输入您的手机号码</label></p>
				<button>确认</button>
			</div>
			
			<div class="do">
				<strong>我想用Email订阅</strong>
				<p><input id="doEmail" type="text" name="" /><label for="doEmail">输入您的Email</label></p>
				<button>确认</button>
			</div>
		</div>
		
		<div class="container">
			<div class="act1" id="mList"></div>
		</div>
	</div>
	<div class="footer">
		#parse('/inc/copyright.htm')
		<p></p>
		<p></p>	
	</div>
</div>

<!---->
<div class="footer-wrapper">
	<div class="footer">
		#parse('/inc/nav.htm')
		##parse('/inc/copyright.htm')
	</div>
</div>

<!---->
<div id="NavLeft"><a href="javascript:void(0)">Show</a></div>
<div id="NavRight"><a href="javascript:void(0)">Star</a></div>

<!--Dialog-->
<div class="actdialog" id="actDialog">
	<h3>活动申请</h3>
	<a class="close" href="javascript:void(0)">关闭</a>
	
	<div class="cont">
		<p>请填写以下报名表，报名成功后将以短信方式通知您。</p>
		<ul><li class="d1"><strong>姓名：</strong><input type="text" name="" /></li>
			<li class="d1"><strong>电话：</strong><input type="text" name="" /></li>
			<li><strong>证件号：</strong><input class="d2" type="text" name="" /></li>
			<li><strong>地址：</strong><input class="d2" type="text" name="" /></li>
			<li><strong>邮编：</strong><input type="text" name="" /></li>
		</ul>
		<button name="">参与此活动</button>
	</div>
</div>

<script type="text/javascript">
$(function(){
	mfall(page);
	mailtype();
})

var page = 1;
$(window).scroll(function(){
	var sT = document.documentElement.scrollTop || document.body.scrollTop;
	var pH = document.documentElement.clientHeight || document.body.clientHeight;
	var dH = $("#Wrapper").outerHeight();
	
	setInterval(function(){
		dH = $("#Wrapper").outerHeight();
	},50);
	
	if(sT >= dH - pH){
		page++;
		mfall(page);
	}
});


function mfall(i){
	$.ajax({
		url:'/type.do?parameter=list&tid=$!thisType.id',
		data:{"page":i}
	}).done(function(data){
		var data = eval(data);
		$.each(data.list,function(i,item){
			html = '<div class="cell"><a href="'+item.links+'"><img src="'+item.img+'" alt="" /></a><p><a href="'+item.links+'">'+item.title+'</a></p><em>'+item.time+'</em><div class="ctrl"><p class="p0"><a class="a0" href="#">微博</a><a class="a1" href="#">腾讯微博</a></p></div></div>';	
			$(html).appendTo($("#mList"));
		})
	});
}

function mailtype(){
	$("#ActDo p").each(function(){
		var $p = $(this);
		var sT;
		$(">input",$p).focus(function(){
			clearInterval(sT);
			var $v = $(this).val();
			if($v == ''){
				$(">label",$p).show().css({"opacity":0.5});
			}else{
				$(">label",$p).hide();
			}
			
			$(this).keyup(function(){
				var $this = $(this);
				//sT = setInterval(function(){
					var $v = $this.val();
					if($v == ''){
						$(">label",$p).show().css({"opacity":0.5});
					}else{
						$(">label",$p).hide();
					}
				//},20);
			});
		}).blur(function(){
			clearInterval(sT);
			var $v = $(this).val();
			if($v == ''){
				$(">label",$p).show().css({"opacity":1});
			}else{
				$(">label",$p).hide();
			}
		});
	});
}

//
function getActDialog(id){
	if($("#bgDiv").length == 0){
		$("body").append("<div id='bgDiv' />");
		$("#bgDiv").css("opacity",0.9);
	}
	
	var pw = document.documentElement.clientWidth || document.body.clientWidth,
		ph = document.documentElement.clientHeight || document.body.clientHeight;
	
	var dw = $("#actDialog").width() , dh = $("#actDialog").height();
	
	$("#actDialog").css({
		top:(ph - dh) /2,
		left:(pw - dw) /2
	}).fadeIn();
	$("#bgDiv").fadeIn();
	
	$("#actDialog a.close").click(function(){
		$("#actDialog,#bgDiv").fadeOut();
	});
}
</script>

</body>
</html>
